<!-- 必看文章 -->
<div class="card-widget card-recent-post" th:with='
    postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg+"&" : theme.config.layout.postRandomImg+"?"}'>
    <div class="item-headline"><i class="haofont hao-icon-bookmark"></i><span>必看文章</span></div>
    <div class="aside-list">
        <!-- 必看文章：按照置顶或特定分类展示 -->
        <div class="aside-list-item" th:each="post : ${postFinder.list({page: 1, size: 5, sort: {'spec.pinned,desc', 'spec.publishTime,desc'}})}">
            <a class="thumbnail" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
                <img th:alt="${post.spec.title}"
                     th:with="img = ${#strings.isEmpty(post.spec.cover) ? postRandomImg+post.spec.title : thumbnail.gen(post.spec.cover, 's')}"
                     th:src="${isLazyload ? loadingImg : img}"
                     th:data-lazy-src="${ isLazyload ? img : ''}">
            </a>
            <div class="content">
                <a class="title" th:href="@{${post.status.permalink}}" th:text="${post.spec.title}" th:title="${post.spec.title}"></a>
                <time th:attr="datetime=${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm:ss')}"
                      th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"
                      th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">
                </time>
            </div>
        </div>
    </div>
</div>

